#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H
#include<QMouseEvent>
#include <QWidget>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);
    ~MusicSlider();

public:
    void moveSlide();
    void syncSlide(float value);

protected:
    virtual void mousePressEvent(QMouseEvent* event)override;
    virtual void mouseMoveEvent(QMouseEvent* event)override;
    virtual void mouseReleaseEvent(QMouseEvent* event)override;

signals:
    void setMusicSliderPostion(float value);


private:
    Ui::MusicSlider *ui;

    qint64 _currentPosition;//滑块当前位置
    qint64 _maxWidth;//滑块的最大宽度
};

#endif // MUSICSLIDER_H
